#include <cstdio>
#include <cstring>
#include <cmath>

#define TODAY 20220421
#define THIS_WEEKDAY 4

int ProcessMonthStr(char[]);
int DaysOfYear(int, int, int);
int DiffDays(int, int, int, int);
int CalcuDiffDays(int, int);

int main()
{
    int year, month_int, day, date;
    char month_str[10];
    char weekdays[7][10] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};

    while (scanf("%d %s %d", &day, month_str, &year) != EOF) {
        month_int = ProcessMonthStr(month_str);
        date = year * 10000 + month_int * 100 + day;
        int diff_days = CalcuDiffDays(date, TODAY);
        // printf("%d\n", diff_days);
        if (date >= TODAY)
            printf("%s\n", weekdays[(THIS_WEEKDAY + diff_days - 1) % 7]);
        else 
            printf("%s\n", weekdays[7 - abs(THIS_WEEKDAY - diff_days) % 7 - 1]);
    }
}

int ProcessMonthStr(char month_str[])
{
    if (strcmp(month_str, "January") == 0)
        return 1;
    else if (strcmp(month_str, "February") == 0)
        return 2;
    else if (strcmp(month_str, "March") == 0)
        return 3;
    else if (strcmp(month_str, "April") == 0)
        return 4;
    else if (strcmp(month_str, "May") == 0)
        return 5;
    else if (strcmp(month_str, "June") == 0)
        return 6;
    else if (strcmp(month_str, "July") == 0)
        return 7;
    else if (strcmp(month_str, "August") == 0)
        return 8;
    else if (strcmp(month_str, "September") == 0)
        return 9;
    else if (strcmp(month_str, "October") == 0)
        return 10;
    else if (strcmp(month_str, "November") == 0)
        return 11;
    else
        return 12;       
}

int DaysOfYear(int year, int month, int day)
{
    int month_day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    if (year % 4 == 0 && year % 100 != 0) 
        month_day[1] = 29;
    if (year % 400 == 0)
        month_day[1] = 29;

    int number_days = 0;
    for (int i = 0; i < month - 1; i++)
        number_days += month_day[i];
    return number_days + day;
}

int DiffDays(int a_year, int a_days, int b_year, int b_days)
{
    int diff_days = 0;
    for (int i = a_year; i < b_year; i++) {
        if (i % 4 == 0 && i % 100 != 0)
            diff_days += 366;
        else if (i % 400 == 0)
            diff_days += 366;
        else
            diff_days += 365;
    }
    return diff_days - a_days + b_days;
}

int CalcuDiffDays(int date, int today)
{
    int year = date / 10000, month = (date % 10000) / 100, day = date % 100;
    int this_year = today / 10000, this_month = (today % 10000) / 100, this_day = today % 100;

    int a_number_day_in_year = DaysOfYear(year, month, day);
    int b_number_day_in_year = DaysOfYear(this_year, this_month, this_day);

    int diff_days = 0;
    if (date < TODAY) 
        diff_days = DiffDays(year, a_number_day_in_year, this_year, b_number_day_in_year);
    else
        diff_days = DiffDays(this_year, b_number_day_in_year, year, a_number_day_in_year);
    
    return diff_days;
}